<?php

namespace App\Validate;

class WxserviceValidation extends BaseValidation
{
    // 调用案例 check支持自定义规则

    // make(AmountValidation::class)->check($this->request->all(),__FUNCTION__)

    //返回响应值的  ->response()

    //返回boole   ->get()

    //返回报错信息  ->getError()

    //验证规则
    protected $rule =[
        'title'=>'required',
        'mobile'=>'required',
        'detail'=>'required',
        'type_id'=>'required',
        'id'=>'required|integer',
        'wxservice_ope_id'=>'required|integer',
    ];
    //自定义验证信息
    protected $message = [
        'title.required'=>'标题 必须',
        'mobile.required'=>'手机号 必须',
        'detail.required'=>'详情 必须',
        'type_id.required'=>'类型 必须',
        'id.required'=>'id 必须',
    ];
    
    //自定义场景
    protected $scene = [
        'form_msg'=>"title,mobile,detail,type_id",
        'admin_edit'=>"id",
        'admin_edit_submit' => "id,statue" ,
        'admin_edit_type'=>"id,title,pid",
        'classifyAdd'=>"title",
        'classifyEdit_get'=>"id",
        'classifyEdit_post'=>"id,title",
        'classifyDel'=>"id",
        'typeAdd'=>"wxservice_ope_id,title",
        'typeEdit_get'=>"id",
        'typeEdit_post'=>"id,title,wxservice_ope_id",
        'typeDel'=>"id",
    ];
}
